package com.wms.model;

import com.wms.assets.User;

/**
 * Perhaps poorly-named, this class provides the current authentication information.
 * @author Nathan
 */
public class UserModel {
	private static UserModel INSTANCE;
	private boolean authenticated = false;
	private User current;
	private UserModel() {
	}
	
	public static UserModel getInstance() {
		if (INSTANCE == null)
			INSTANCE = new UserModel();
		return INSTANCE;
	}
	
	public boolean getAuthenticated() {
		return authenticated;
	}
	
	public User getCurrentUser() {
		return current;
	}
	
	public void loginUser(User user) {
		authenticated = true;
		current = user;
	}
	
	public void logoutCurrentUser() {
		authenticated = false;
		current = null;
	}
}
